<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>登录</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />

		<link rel="stylesheet" href="{{asset('Home/css')}}/amazeui.css" />
		<link href="{{asset('Home/css')}}/dlstyle.css" rel="stylesheet" type="text/css">
		<script src="{{asset('Home/js')}}/jquery.min.js"></script>
		<script src="{{asset('Home/js')}}/amazeui.min.js"></script>
	</head>

	<body>

		<div class="login-boxtitle" style="background:white">
			<a href="/"><img alt="logo" src="{{asset('Home/images')}}/qqa.jpg" style="height:55px;margin:20px"/></a>
		</div>

		<div class="login-banner">
			<div class="login-main">
				<div class="login-banner-bg"><span></span></div>
				<div class="login-box">

					<h3 class="title">登录商城</h3>

					<div class="clear"></div>

					<div class="login-form">
						<form action='javascript:;' method="post">
							<div class="user-name">
								<label for="user"><i class="am-icon-user"></i></label>
								<input type="text" name="uname" id="username" placeholder="请输入用户名">
								<span id="name0" style="display:none;color:red;font-size:13px">用户名不能为空</span>
							</div>

							<div class="user-pass">
								<label for="password"><i class="am-icon-lock"></i></label>
								<input type="password" name="upass" id="password" placeholder="请输入密码">
								<span id="pass0" style="display:none;color:red;font-size:13px">密码不能为空</span>

							</div>
							<div class="verification">
								<label for="code"><i class="am-icon-code-fork"></i></label>
								<input type="tel" name="code" id="code" placeholder="请输入验证码" style="width:165px">
								<img src="{{url('/makecode')}}" alt="" id="codeimage" onclick="this.src='{{url('/makecode')}}?'+Math.random();" style="">

							</div>

						</form>
					</div>

					<div class="login-links" >
						<a href="{{asset('password/reset')}}" class="am-fr" style="margin-top:-20px; font-size:16px;">忘记密码</a>
						<a href="/finalregister" class="zcnext am-fr am-btn-default" >注册</a>
						<br />
					</div>
					<div class="am-cf">

						<input type="submit" name="" value="登 录" class="am-btn am-btn-primary am-btn-sm am-login" style="margin-top:-35px; background-color:#F3726D;border-color:#F3726D">

					</div>


				</div>
			</div>
		</div>

		<script>

			//判断用户名不能为空，当失去焦点时
		    $('input[name="uname"]').blur(function () {
		        //判断用户名是否为空，为空则显示不能为空
		        if ($('input[name="uname"]').val().length == 0) {
							$("#name0").css("display","block");
							$("input[name='uname']").on('focus',function() {
								$("#name0").css("display","none");
							});
							return false;
		        }
			});
		    //判断密码不能为空，当失去焦点时
		    $('input[name="upass"]').blur(function () {
		        //判断用户名是否为空，为空则显示不能为空
		        if ($('input[name="upass"]').val().length == 0) {
							$("#pass0").css("display","block");
							$("input[name='upass']").on('focus',function() {
								$("#pass0").css("display","none");
							});
							return false;
		        }
			}); 

		    $('.am-login').on('click',function() {
		    	var uname = $('input[name="uname"]').val();
		    	var upass = $('input[name="upass"]').val();
		    	var ucode = $('input[name="code"]').val();
		    	$.ajax({
		    		type:'post',
		    		url: '{{url("/dologin")}}',
		    		data:'name='+uname+'&pass='+upass+'&code='+ucode+'&_token={{csrf_token()}}',
		    		success:function (data) {
		    					if(data.status == 1200){

										alert('登录成功');
										location.href = '{{url("/")}}';
								}else if(data.status == 1404){

										alert('登录失败,用户不存在');
								}else if(data.status == 1402) {

										alert('密码错误');
								}else if(data.status == 1506) {

										alert('验证码错误');
								}else if (data.status == 1501) {

									$("#name0").css("display","block");
									$("input[name='uname']").on('focus',function() {
										$("#name0").css("display","none");
									});
								}else if (data.status == 1502) {

									$("#pass0").css("display","block");
									$("input[name='upass']").on('focus',function() {
										$("#pass0").css("display","none");
									});
								}else if (data.status == 1800) {
										alert('你刚刚输错很多次密码，为了保证账户安全，系统已经将您账号锁定10min');
								}
		    				}
		    		})
		    });
		</script>

		<div class="footer ">
			<div class="footer-hd ">
				<p>
					<a href="# ">恒望科技</a>
					<b>|</b>
					<a href="# ">商城首页</a>
					<b>|</b>
					<a href="# ">支付宝</a>
					<b>|</b>
					<a href="# ">物流</a>
				</p>
			</div>
			<div class="footer-bd ">
				<p>
					<a href="# ">关于恒望</a>
					<a href="# ">合作伙伴</a>
					<a href="# ">联系我们</a>
					<a href="# ">网站地图</a>
					<em>© 2015-2025  版权所有. elgots@163.com</em>
				</p>
			</div>
		</div>
	</body>

</html>
